From: jarry1250 Date: Wed, 17 Oct 2012 22:00:54 +0000 (+0100) Subject: Followup I15843fab: don't show &page=1 in file link X-Git-Tag: 1.31.0-rc.0~21965^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=09e44a68fcdf8fa4c9a3a3c70d57b8891493b760;p=lhc%2Fweb%2Fwiklou.git Followup I15843fab: don't show &page=1 in file link By standardising the file parameters were handed around, the normalised parameter "page" (set to 1) is being passed to the linker. Since it's the default, I don't think we really need it in the link, where it is (a) meaningless and (b) confusing, since it is set for some media types that don't even have pages (e.g. SVGs). Change-Id: Ib80a85125366ec32ab05b061b06d28144dc244fc --- diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 69bdc2fb21..97a2d1d136 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -196,7 +196,10 @@ abstract class MediaTransformOutput { * @return array */ public function getDescLinkAttribs( $title = null, $params = '' ) { - $query = $this->page ? ( 'page=' . urlencode( $this->page ) ) : ''; + $query = ''; + if ( $this->page && $this->page !== 1 ) { + $query = 'page=' . urlencode( $this->page ); + } if( $params ) { $query .= $query ? '&'.$params : $params; }